package com.ai.web.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ai.web.service.WxKeywordConfigService;
import com.ai.web.vo.ResultModel;
import com.ai.web.vo.WxKeywordConfigV;
import com.tiny.persistence.domain.WxKeywordConfig;
import com.tiny.persistence.repository.WxKeywordConfigRepo;

@Service
public class WxKeywordConfigServiceImpl extends BaseServiceImpl<WxKeywordConfig, Integer, WxKeywordConfigV> implements WxKeywordConfigService  {

    @Autowired
    private WxKeywordConfigRepo wxKeywordConfigRepo;
    
    @Autowired
    public WxKeywordConfigServiceImpl(WxKeywordConfigRepo wxKeywordConfigRepo) {
        super(wxKeywordConfigRepo);
    }

    public WxKeywordConfigV getWxKeywordConfig(int id) throws Exception {
        return getT(id);
    }

    public ResultModel saveWxKeywordConfig(WxKeywordConfigV wxKeywordConfigV) throws Exception {
        
        WxKeywordConfigV saveV = saveT(wxKeywordConfigV);
        
        ResultModel rm = new ResultModel();
        rm.setData(saveV);
        rm.setSuccessCode();
        
        return rm;
    }

    public ResultModel deleteWxKeywordConfigs(List<Integer> ids) throws Exception {
        deleteTs(ids);
        
        ResultModel rm = new ResultModel();
        rm.setSuccessCode();
        rm.setMsg("删除成功！");
        
        return rm;
    }
}
